#!/usr/bin/env python3
import django
import os
import time

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'wealth_backend.settings_mysql')
django.setup()

from data_service.models import FundInfoDetail

print("开始监控基金数据变化...")
print("按 Ctrl+C 停止监控")

try:
    while True:
        count = FundInfoDetail.objects.count()
        current_time = time.strftime('%Y-%m-%d %H:%M:%S')
        print(f"[{current_time}] fund_info_detail表中的数据条数: {count}")
        time.sleep(10)
except KeyboardInterrupt:
    print("\n监控已停止")